//
//  WYForgetPasswordController.m
//  CirclePush
//
//  Created by admin on 2018/4/24.
//  Copyright © 2018年 admin. All rights reserved.
//

#import "WYForgetPasswordController.h"
#import "UIButton+CountDown.h"
@interface WYForgetPasswordController ()

@property (strong, nonatomic) IBOutlet UITextField *userNameField;
@property (strong, nonatomic) IBOutlet UITextField *codeField;
@property (strong, nonatomic) IBOutlet UITextField *pwdTextfield;
@property (strong, nonatomic) IBOutlet UITextField *surePwdField;
@property (strong, nonatomic) IBOutlet UIButton *codeButton;

@property (strong, nonatomic) IBOutlet NSLayoutConstraint *topHeight;




@end

@implementation WYForgetPasswordController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setupUI];
    // Do any additional setup after loading the view from its nib.
}
-(void)setupUI
{
    [self initTopBarWithTitle:@"找回密码"];
    [self addLeftButton:[UIImage imageNamed:@"return"] width:0 height:0];
    self.topHeight.constant = NavHeight+10;
    self.view.backgroundColor = [UIColor whiteColor];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (IBAction)getCode:(id)sender {
    
    [self.codeButton startWithTime:59 title:@"重新获取" countDownTitle:@"s后重新获取" mainColor:[UIColor whiteColor] countColor:[UIColor hexStringToColor:@"#3B80F8" alpha:1.0]];
    
    [WYHttpServer sendMessageWithTelephone:self.userNameField.text SucessBlock:^(BOOL success, id response, NSString *errorMessage) {
        
        
        
    }];
    
    
    
}
- (IBAction)retrievePwd:(id)sender {
    WEAKSELF
    [WYHttpServer editNumber:self.userNameField.text Withpassword:self.pwdTextfield.text WithCode:self.codeField.text WithHeadImg:nil SucessBlock:^(BOOL success, id response, NSString *errorMessage) {
       
        if (success) {
            [weakSelf toast:@"修改成功"];
            [self.navigationController popViewControllerAnimated:YES];
        }else{
            [weakSelf toast:errorMessage];
        }
    }];
    
    
    
    
}


@end
